package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IntergalRuleMapper;
import com.ruoyi.system.domain.IntergalRule;
import com.ruoyi.system.service.IIntergalRuleService;

/**
 * 积分规则表的增删改查Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-19
 */
@Service
public class IntergalRuleServiceImpl implements IIntergalRuleService 
{
    @Autowired
    private IntergalRuleMapper intergalRuleMapper;

    /**
     * 查询积分规则表的增删改查
     * 
     * @param id 积分规则表的增删改查主键
     * @return 积分规则表的增删改查
     */
    @Override
    public IntergalRule selectIntergalRuleById(Long id)
    {
        return intergalRuleMapper.selectIntergalRuleById(id);
    }

    /**
     * 查询积分规则表的增删改查列表
     * 
     * @param intergalRule 积分规则表的增删改查
     * @return 积分规则表的增删改查
     */
    @Override
    public List<IntergalRule> selectIntergalRuleList(IntergalRule intergalRule)
    {
        return intergalRuleMapper.selectIntergalRuleList(intergalRule);
    }

    /**
     * 新增积分规则表的增删改查
     * 
     * @param intergalRule 积分规则表的增删改查
     * @return 结果
     */
    @Override
    public int insertIntergalRule(IntergalRule intergalRule)
    {
        intergalRule.setCreateTime(DateUtils.getNowDate());
        return intergalRuleMapper.insertIntergalRule(intergalRule);
    }

    /**
     * 修改积分规则表的增删改查
     * 
     * @param intergalRule 积分规则表的增删改查
     * @return 结果
     */
    @Override
    public int updateIntergalRule(IntergalRule intergalRule)
    {
        intergalRule.setUpdateTime(DateUtils.getNowDate());
        return intergalRuleMapper.updateIntergalRule(intergalRule);
    }

    /**
     * 批量删除积分规则表的增删改查
     * 
     * @param ids 需要删除的积分规则表的增删改查主键
     * @return 结果
     */
    @Override
    public int deleteIntergalRuleByIds(Long[] ids)
    {
        return intergalRuleMapper.deleteIntergalRuleByIds(ids);
    }

    /**
     * 删除积分规则表的增删改查信息
     * 
     * @param id 积分规则表的增删改查主键
     * @return 结果
     */
    @Override
    public int deleteIntergalRuleById(Long id)
    {
        return intergalRuleMapper.deleteIntergalRuleById(id);
    }
}
